package com.ftg.learn.chapter16;

/**
 * @author KangJx
 * @date 2021/8/2
 */
public class TEst {

    public static String test() {
        String result = "";
        try {
            result = "try";
            return result;
        }
        catch (Exception e) {
            result = "catch";
            return result;
        }
        finally {
            result = "finally";
        }
    }

    public static int test1() {
        int result = 3;
        try {
            result = 4;
            return result;
        }
        catch (Exception e) {
            result = 5;
            return result;
        }
        finally {
            result = 6;
        }
    }
    public static int test2(){
        //jdk 1.8
        int a = 1;
        try{
            return a++;
        }catch(ArithmeticException e){
            return  a++;
        }finally{
            return  a++;
        }
    }


    public static void main(String[] args) {
        //0 上午 1
        //1 下午 1 1
        System.out.println((int)(Math.random() * 2));


    }

}
